Skip to content

SvelteKit-based WebUI #14839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 159 commits into
base: master
Choose a base branch
from
Draft

Conversation

allozaur
Copy link
Collaborator

No description provided.

allozaur added 15 commits July 21, 2025 13:16
Sets up a new SvelteKit project for the web UI with Storybook & ShadCN installed

This includes adding base files, Storybook configuration,
Prettier and ESLint configurations, a test setup, and basic
styling with Tailwind CSS.
Adds a theme mode watcher to the web UI.

This allows the UI to automatically switch between light and dark
mode based on the user's system preferences.
Introduces a script for streamlined web UI development.

This script simplifies the process of starting a development server with configurable options for model selection (local or Hugging Face), port number, and build execution. It improves the developer experience by automating setup and providing helpful usage instructions.
Changes the SvelteKit adapter to `@sveltejs/adapter-static`.
This allows for generating static HTML files for improved
performance and easier deployment to static hosting providers.

Configures the adapter to output files to the `../public` directory
and to use `index.html` as a fallback.
Implements a proof-of-concept SvelteKit application with core chat functionalities.

This includes:
- UI components for chat messages and input
- A chat service for handling API requests
- State management using Svelte reactivity
@@ -0,0 +1,38 @@
# sv
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update README file

@bayorm
Copy link

bayorm commented Jul 26, 2025

what is reason to change from react -> svelte? Would it be better just to improve UI with react?

Stops polling for available slots when context errors occur during chat completion.
This prevents unnecessary polling when the user's message is removed due to context issues.
@mashdragon
Copy link
Contributor

A number of us are frustrated by some of the default webui settings (see #14041 and #14468) which we as llama.cpp webui runners cannot change without recompiling the webui code manually, a burden, and I see this PR continues to have hard-coded default settings. Would you mind integrating the changes from @woof-dog's #14468 into this Svelte PR? All it does is set default local storage settings if they're not already set yet, using the /props endpoint. I would do the integration on my own if I knew Svelte well enough.

I know you are working for Hugging Face and probably have enough orders. But we have been ignored and it would be a huge UI win to allow us users to define default settings at runtime. Riding the change into this PR would give us UI freedom like a working paste shortcut back... Thank you.

Enhances error handling in the chat service with user-friendly messages for various server errors and network issues.

Implements loading and error splash screens to provide better UI feedback during server connection and error states, improving user experience.

Gracefully degrades slots monitoring if the server does not support the slots endpoint, preventing application crashes.
Improves PDF processing by bundling the PDF.js worker inline.
@allozaur
Copy link
Collaborator Author

allozaur commented Aug 15, 2025

A number of us are frustrated by some of the default webui settings (see #14041 and #14468) which we as llama.cpp webui runners cannot change without recompiling the webui code manually, a burden, and I see this PR continues to have hard-coded default settings. Would you mind integrating the changes from @woof-dog's #14468 into this Svelte PR? All it does is set default local storage settings if they're not already set yet, using the /props endpoint. I would do the integration on my own if I knew Svelte well enough.

I know you are working for Hugging Face and probably have enough orders. But we have been ignored and it would be a huge UI win to allow us users to define default settings at runtime. Riding the change into this PR would give us UI freedom like a working paste shortcut back... Thank you.

Hey @mashdragon, thanks for tuning in :) it's already on our list of wanted features, and though it won't be included in this particular PR, it will be added in a near future. I will also add this to my personal prio list to take care of this sooner than later ;)

Refactors the chat form to include a dropdown menu for selecting different file types to attach.

Adds a new component for the file attachment action.

Also prevents form submission when clicking on attachments.
@github-actions github-actions bot added the devops improvements to build systems and github actions label Aug 15, 2025
@allozaur allozaur force-pushed the allozaur/svelte-webui branch 5 times, most recently from 508e78b to 66dc816 Compare August 15, 2025 23:59
@allozaur allozaur force-pushed the allozaur/svelte-webui branch from 66dc816 to 158ab08 Compare August 15, 2025 23:59
@mashdragon
Copy link
Contributor

@allozaur All right, that's great. Thank you very much for responding.

@olegshulyakov
Copy link

Maybe it is time to create a separate repo for the WebUI?

@allozaur allozaur force-pushed the allozaur/svelte-webui branch 2 times, most recently from cce8c12 to a7c6fca Compare August 17, 2025 22:59
@allozaur allozaur force-pushed the allozaur/svelte-webui branch from a7c6fca to edd48eb Compare August 17, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions examples script Script related server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants